package demo.code;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import org.apache.log4j.FileAppender;
import org.apache.log4j.HTMLLayout;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.WriterAppender;

public class HtmlAndWrite {
	static Logger logger = Logger.getLogger(HtmlAndWrite.class);
	public static void main(String args[]) throws IOException {
		HTMLLayout layout=new HTMLLayout();
		WriterAppender appender=null;
		
		OutputStream outputStream=new FileOutputStream("output_by_code/HtmlAndWriteOutput.html");
		appender=new WriterAppender(layout, outputStream);
		logger.addAppender(appender);
		
		logger.setLevel((Level) Level.DEBUG);

		logger.debug("Here is some DEBUG");

		logger.info("Here is some INFO");

		logger.warn("Here is some WARN");

		logger.error("Here is some ERROR");

		logger.fatal("Here is some FATAL");
		
	}
}
